package cn.caplike.demo.repository.design.pattern.flyweight;

import java.util.stream.Stream;

public class Client {

    public static void main(String[] args) {
        Stream.of("1", "1", "2", "2", "1").forEach(key -> {
            Flyweight flyweight = FlyweightFactory.getFlyweight(key);
            flyweight.operation("测试" + key);
        });

        System.out.println("size: " + FlyweightFactory.size());
    }
}
